import java.util.HashMap;


class P11428_39643 {

    static String readLn() {
        String newLine = System.getProperty("line.separator");
        StringBuilder buffer = new StringBuilder();
        int car = -1;
        try {
            car = System.in.read();
            while ((car > 0) && (car != newLine.charAt(0))) {
                buffer.append((char) car);
                car = System.in.read();
            }
            if (car == newLine.charAt(0))
                System.in.skip(newLine.length() - 1);
        } catch (java.io.IOException e) {
            return (null);
        }
        if ((car < 0) && (buffer.length() == 0))
            return (null);
        return (buffer.toString()).trim();
    }

   
    static int[] array = new int[101];
   
    static HashMap<Integer, int[]> map = new HashMap<Integer, int[]>();
   
    public static void main(String[] args) {
   
        for (int k = 0; k < 101; k++) {
            array[k] = k * k * k;
//            System.out.println(array[k]);
        }
       
        process();
       
        while (true) {
            int n = Integer.parseInt(readLn());
           
            if (n == 0)break;
           
            int[] result = map.get(n);
           
            if (result == null) System.out.println("No solution");
            else {
                System.out.println(result[1] + " " + result[0]);
            }
           
        }
       
    }


    private static void process() {
       
        for (int k = 1; k < 100; k++) {
            for (int j = k + 1; j < 100; j++) {
                int[] a = new int[2];
                a[1] = j;
                a[0] = k;
//System.out.println((array[j] - array[k]) + " " + a[1] + ", " + a[0]);   
                int i = array[j] - array[k];
               
                int[] exists = map.get(i);
               
                if (exists == null)
                    map.put(i, a);
                else {
                    if (exists[0] > a[0]) {
                        map.put(i, a);
                    }
                }
               
            }
        }
       
    }
   
}